<#include "macro/include.ftl"/>
<html>
	<head>
		<title>牛牛妞妞 | 互助</title>
	</head>
	<body>
		<script type="text/javascript">
			var costId=${costId};
			var userId=${userId};
			var categoryId=${categoryId};	
			var pid=1;	
			var pageFavor=function(_pid, _costId, _categoryId) {
				if (_pid||_pid==0)
					pid=_pid;
				if (_costId||_costId==0)
					costId=_costId;
				if (_categoryId||_categoryId==0)
					categoryId=_categoryId;
				//init url
				_pid="pageId="+pid;
				if (costId!=0)
					_costId="&costId="+costId;
				else
					_costId="";
				if (userId!=0)
					_userId="&userId="+userId;
				else
					_userId="";
				if (categoryId!=0)
					_categoryId="&categoryId="+categoryId;
				else
					_categoryId="";			
				new Ajax.Request(url_page_favor,{parameters:_pid+_costId+_userId+_categoryId, 
								onSuccess:handlerFunc});
			};
			var handlerFunc = function(t) {
				var _favorPage = $("favorpage");
			    _favorPage.innerHTML = t.responseText;
			};			
		</script>
		<div class="main_module">
			<input id="navtype" type="hidden" value="favor"/>		
			<div style="width:100%;text-align:center;">
				<a href="javascript:pageFavor(1, 0)">全部(${favorPage.count})</a>
				<#list costs as cs>
					&nbsp;|&nbsp;<a href="javascript:pageFavor(1, ${cs.id})">${cs.name}(${cs.count})</a>
				</#list>
			</div>
			<div id="favorpage" style="width:100%;height:540px;">
				<#include "pageFavor.ftl"/>
			</div>
		</div>
	</body>
</html>